<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>搜索输入框</title>
    <link href="//netdna.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
    <style>
        .search{
            position: absolute;
            left:50%;
            top:50%;
            transform: translate(-50%,-50%);

        }
        .search input{
            background-color: #2F3640;
            border: none;
            height: 60px;
            width: 60px;
            outline: none;
            color: white;
            font-size: 25px;
            border-radius: 30px;
            transition: all 0.5s;
            box-sizing: border-box;
            padding:0 30px;

        }
        .search button{
            height: 40px;
            width: 40px;
            border: none;
            border-radius: 50%;
            outline: none;
            cursor: pointer;
            position: absolute;
            right: 10px;
            top:10px;
            /* transform: translate(50%,-50%); */
            background-color: #2F3640;
            color: orange;
            font-size: 1.3em;
            transition: all 0.5s;
            
        }
        .search:hover button{
            background-color: #fff;
        }
        .search:hover input{
            width: 300px;
            padding:0 60px 0 20px;
        }
    </style>
</head>
<body>
    <div class="search">
        <input type="text">
        <button><i class="fa fa-search"></i></button>
    </div>
</body>
</html>